package com.ruoyi.common.rabbitmq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MrPing
 */
@Configuration
public class RabbitMqDeadConfig {

    @Bean
    public DirectExchange deadExchange(){
        return new DirectExchange("yuanju.dead.order.direct.exchange", true, true);
    }

    @Bean
    public Queue deadQueue(){
        return new Queue("yuanju.dead.order.queue",true);
    }

    @Bean
    public Binding deadBinding(){
        return BindingBuilder.bind(deadQueue()).to(deadExchange()).with("dead");
    }
}
